-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Tornado 16X SQ air conditioner (0x4E2A) #520
Conversation
0890deb
to
acddf5f
Compare
acddf5f
to
1c9fbb5
Compare
Hi @enosh. I rebased so it doesn't get lost in time. Still work? I wish we could have this in v0.17.0, because I don't know how many chances we will have after that. |
59a308e
to
1ef9eec
Compare
Hey, been away for a while, this looks very neat. As for the interface, I think the only remaining question is whether to add a function that sets only part of the state and retrieves the rest. The user can do this on their own but it's a nice to have. Also isolated the "ifeel" option. Since I can't push to your branch I put the commit here. |
broadlink/climate.py
Outdated
s = sum([v if i % 2 == 0 else v << 8 for i, v in enumerate(data)]) | ||
# trim the overflow and add it to smallest bit | ||
s = (s & 0xffff) + (s >> 16) | ||
return (0xffff - s) # TODO: fix: we can't return negative values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, overflow is unlikely as we are not dealing with packets of this size. & 0xFFFF
should be enough as a safeguard:
return (0xffff - s) & 0xffff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just found the polynomial, now we can do:
crc = CRC16.calculate(payload[0x02:p_len], polynomial=0x9BE4)
I have AUX Mini Split Air Conditioners with the same type that also can be controlled by AC Freedom
I'd be more than happy to help test this if you have the time to rebase it in the future. Would love to see support for these devices! |
Hi, I was trying this PR, here is my testing snippset: #!/usr/bin/python
import broadlink
devices = broadlink.discover(timeout=5)
print(devices)
devices[0].auth() and as the result:
Do you have any clue why is that? Edit/Update:I had to remove the device from "AC Freedom" app (using method: liaan/broadlink_ac_mqtt#76 (comment)), then it is unlocked:
|
This commits add a new type of supported devices, which is air conditioners. I was testing this only on my specific device but I think that the code should also work with other compatible air conditioners. The device was controlled using `AC Freedom` app: https://play.google.com/store/apps/details?id=com.broadlink.acfreedom I was searching for opensource projects for controlling the device but it is not as popular as the IR blasters or other components, so finally I put the pieces together mainly from two projects: https://github.com/liaan/broadlink_ac_mqtt and this not-yet-merged PR: mjg59/python-broadlink#520 so the credits goes to: @liaan and @mjg59
This commits add a new type of supported devices, which is air conditioners. I was testing this only on my specific device but I think that the code should also work with other compatible air conditioners. The device was controlled using `AC Freedom` app: https://play.google.com/store/apps/details?id=com.broadlink.acfreedom I was searching for opensource projects for controlling the device but it is not as popular as the IR blasters or other components, so finally I put the pieces together mainly from two projects: https://github.com/liaan/broadlink_ac_mqtt and this not-yet-merged PR: mjg59/python-broadlink#520 so the credits goes to: @liaan and @felipediel / @mjg59
This commits add a new type of supported devices, which is air conditioners. I was testing this only on my specific device but I think that the code should also work with other compatible air conditioners. The device was controlled using `AC Freedom` app: https://play.google.com/store/apps/details?id=com.broadlink.acfreedom I was searching for opensource projects for controlling the device but it is not as popular as the IR blasters or other components, so finally I put the pieces together mainly from two projects: https://github.com/liaan/broadlink_ac_mqtt and this not-yet-merged PR: mjg59/python-broadlink#520 so the credits goes to: @liaan and @felipediel / @mjg59
This commits add a new type of supported devices, which is air conditioners. I was testing this only on my specific device but I think that the code should also work with other compatible air conditioners. The device was controlled using `AC Freedom` app: https://play.google.com/store/apps/details?id=com.broadlink.acfreedom I was searching for opensource projects for controlling the device but it is not as popular as the IR blasters or other components, so finally I put the pieces together mainly from two projects: https://github.com/liaan/broadlink_ac_mqtt and this not-yet-merged PR: mjg59/python-broadlink#520 so the credits goes to: @liaan and @felipediel / @mjg59
Any update on this? does the library supports tornado ACs? |
Great, I believe we're all set now. Thank you very much, @enosh, and I apologize for the delay. You did a great job! |
This PR is based on @enosh's work: #430. I was helping with the review and the PR ended up getting lost in the midst of so many changes and updates. He was being very cooperative, so I think now is the time for me to do my part. I rebased and cleaned up the code a little bit to have it merged soon.
This is a work in progress.
Todo
payload[10:p_len]